package com.springboot.base;

import net.minidev.json.JSONObject;

import java.util.HashMap;
import java.util.Map;

public class baseConrtoller {
    protected String getResultObjectData(String errorcode,String errormsg,Object pd) {

        Map<String,Object> resultData = new HashMap<String, Object>();
        resultData.put("state", errorcode);
        resultData.put("message", errormsg);
        if(null != pd){
            resultData.put("data", pd);
        }
        return  JSONObject.toJSONString(resultData);
    }

}
